package com.sasis.model;

import java.util.List;

public class DeptInfo extends BaseObject{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private int id;

	private String name;

	private String managerCName;

	private int managerId;

	private int parentId;

	private String parentName;
	private String code;
	private List subList;
	private boolean leaf;
	
	
	 
  

	public boolean getLeaf() { 
		boolean isLeaf = true;
		if (0<this.subList.size()) {
			isLeaf = false;
			
		}
		return isLeaf;
	}

	public void setLeaf(boolean leaf) {
		this.leaf = leaf;
	}

	public List getSubList() {
		return subList;
	}

	public void setSubList(List subList) {
		this.subList = subList;
	}

	public DeptInfo() {
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getManagerCName() {
		return managerCName;
	}

	public void setManagerCName(String managerCName) {
		this.managerCName = managerCName;
	}

	public int getManagerId() {
		return managerId;
	}

	public void setManagerId(int managerId) {
		this.managerId = managerId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getParentId() {
		return parentId;
	}

	public void setParentId(int parentId) {
		this.parentId = parentId;
	}

	public String getParentName() {
		return parentName;
	}

	public void setParentName(String parentName) {
		this.parentName = parentName;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof DeptInfo))
			return false;
		DeptInfo castOther = (DeptInfo) other;

		return (this.getId() == castOther.getId())
				&& ((this.getName() == castOther.getName()) || (this.getName() != null
						&& castOther.getName() != null && this.getName()
						.equals(castOther.getName())))
				&& (this.getParentId() == castOther.getParentId())
				&& (this.getManagerId() == castOther.getManagerId());
	}

	public int hashCode() {
		int result = 17;
        return result;
	}

	public String toString() {
		StringBuffer buffer = new StringBuffer();

	      buffer.append(getClass().getName()).append("@").append(Integer.toHexString(hashCode())).append(" [");
	      buffer.append("name").append("='").append(getName()).append("' ");			
	      buffer.append("parentId").append("='").append(getParentId()).append("' ");			
	      buffer.append("manager").append("='").append(getManagerId()).append("' ");			
	      buffer.append("]");
	      
	      return buffer.toString();
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
 

	 

 
}
